var core = require('core');
var wechat = core.wechat;
var api = core.api;
var SCAN = require('./SCAN');
var subscribe = function(callback){
    var that = this;
    var type = that.EventKey && that.Ticket ? "qrcode" : null;
    api.list.user.reg({openid: that.FromUserName}, function(){
        wechat.length += 1;
        console.log('关注 ========== '+wechat.length);
    });

//respond wit
    if(type === "qrcode"){
        that.EventKey = that.EventKey.split('_')[1];
        return SCAN.call(that, callback);
    }else
        var res = "";
    callback(res);
};

module.exports = subscribe;
